package com.wb3.organizer.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 主键：task_id, 外键：account, 创建时间：createdDT, 描述：comments, 主题：subject, 状态:status,
 * 
 * @author pharen
 */
@Entity
@Table(name="task")
public class Task {

	private int task_id;

	private Account account;

	private long createdDT;

	private String comments;

	private String subject;

	private String status;

	private String priority;

	private Date due;

	@Id
	@Column(name="task_id")
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getTask_id() {
		return task_id;
	}

	public void setTask_id(int task_id) {
		this.task_id = task_id;
	}

	@ManyToOne
	@JoinColumn(name="acc_id")
	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}
	
	@Column(name="createdDT")
	public long getCreatedDT() {
		return createdDT;
	}

	public void setCreatedDT(long createdDT) {
		this.createdDT = createdDT;
	}

	@Column(name="comments")
	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	@Column(name="subject")
	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	@Column(name="status")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name="priority")
	public String getPriority() {
		return priority;
	}

	public void setPriority(String priority) {
		this.priority = priority;
	}

	@Temporal(TemporalType.DATE)
	@Column(name="due")
	public Date getDue() {
		return due;
	}

	public void setDue(Date due) {
		this.due = due;
	}

}
